use my_rust_core::shared::app_config_service;
use sea_orm::{ConnectOptions, Database, DatabaseConnection, DbErr};

pub async fn get_connection() -> Result<DatabaseConnection, DbErr> {
    let mut opt = ConnectOptions::new(&app_config_service::APP_CONFIG.data_source.url);
    opt.sqlx_logging(false);

    Database::connect(opt).await
}
